package projetoesa;


import java.util.ArrayList;


/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author heitor
 */
public class CadastroProfessor {
    
   ArrayList<Professor> professor = new ArrayList<Professor>();
    
    
    public void addProfessor(Professor professor){
        this.professor.add(professor);
    }
    
    
    public void removeProfessor(String nome){
        for (int j = 0; j < this.professor.size(); j++) {
            if (nome.equals(professor.get(j).getNome())) {
                professor.remove(j);
            }
         }
    }
    
   public Professor buscarProfessor(String nome){
      
       for (int i=0;i<professor.size();i++) {
      if(professor.get(i).getNome().equals(nome)){
           return professor.get(i);
      } 
    }return null;
  }
}
